
'=======================================
' 执行所有测试 case
'=======================================
Private Sub test_ALL_case()
    test_VairPair
    test_PrimitivePair
    test_ObjPair
End Sub

'=======================================
' 各类型的测试 case
'=======================================
Private Sub test_VairPair()
    Dim pair As VarPair
    Set pair = New VarPair
    
    ' 读写对象类型
    Dim c As Collection
    Set c = New Collection
    c.Add "11"
    c.Add "12"
    pair.key1 = c
    
    Debug.Assert pair.key1.Count = 2
    
    ' 读写基本类型数据
    pair.Key2 = "abc"
    Debug.Assert pair.Key2 = "abc"
End Sub

Private Sub test_PrimitivePair()
    Dim pair As PrimitivePair
    Set pair = New PrimitivePair
    
    pair.key1 = "k1"
    Debug.Assert pair.key1 = "k1"
    
    pair.Key2 = "abc"
    Debug.Assert pair.Key2 = "abc"
End Sub


Private Sub test_ObjPair()
    Dim pair As ObjPair
    Set pair = New ObjPair
    
    Dim c1 As Collection
    Set c1 = New Collection
    c1.Add "11"
    c1.Add "12"
    
    pair.key1 = c1
    Debug.Assert pair.key1.Count = 2
    
    Dim c2 As Collection
    Set c2 = New Collection
    c2.Add "xx"
    
    pair.Key2 = c2
    Debug.Assert pair.Key2.Count = 1
End Sub

